import prisma from '~~/lib/prisma'
import { Result } from '~~/lib/helper/result'

export default defineEventHandler(async () => {
  try {
    const notes = await prisma.note.findMany()
    return Result.Ok(notes, 200, '获取所有文章成功！')
  } catch (error) {
    return Result.Error('获取所有文章失败！')
  }
})
